import java.io.IOException;

import glupson.Glupson;
import junit.framework.TestCase;


public class GlupsonTest extends TestCase {
	
	public GlupsonTest(String arg0) {
		super(arg0);
	}
	
	public void testSquare(){
		Glupson glupson = new Glupson();
		assertEquals(169.2601, glupson.square(13.01), 0.1);
	}
	public void testSum(){
		Glupson glupson = new Glupson();
		assertEquals(32.87, glupson.sum(13.01, 19.86), 0.1);
	}
	public void testMul(){
		Glupson glupson = new Glupson();
		assertEquals(2.60166, glupson.mul(1.31, 1.986), 0.1);
	}
	public void testDiv1(){
		try{
			Glupson glupson = new Glupson();
			assertEquals(1.5265, glupson.div(19.86, 13.01), 0.1);
		}
		catch(IOException e){
			System.err.println("Nemoguce dijeliti nulom :P ");
			e.printStackTrace();
		}
		
	}
	public void testDiv2(){
		try{
			Glupson glupson = new Glupson();
			assertEquals(26.0, glupson.div(11.0, 0.0), 1.0);
		}
		catch(IOException e){
			System.err.println("Nemoguce dijeliti nulom :P ");
			e.printStackTrace();
		}
		
	}
	
}
